<me:UIZABED x:Class="WPFExcelReport.TZA02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    Background="White"  
                     x:Name="TV"
                    FontSize="14"
                    Loaded="Window_Loaded"
     >
    <me:UIZABED.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:Divideby100 x:Key="d100"/>
        <ucd:Divideby1000 x:Key="d1000"/>
    </me:UIZABED.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel  VerticalAlignment="Top">
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Grid.Column="0"  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24"  >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Click="EditCommand" Width="24" Height="20">
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button  Grid.Column="0"   Click="ManageCommand" Width="24" Height="20"  >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Extend.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top" 
                      Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </Grid>
                <Grid Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <me:TSZA02  Grid.Column="1" KEY="{Binding ZABNR ,ElementName=TV}"
                                 ORDERNUM="{Binding ZABNR ,ElementName=TV}"
                                IsEdit="True"
                                />
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock FontSize="16"  Text="{Binding Source={Localization:Translate Word=说明}}"/>
                    <ex:TXT72 Grid.Column="1" FontSize="16"   IsAutoClear="True" CharacterCasing="Upper" 
                              Text="{Binding DES,ElementName=TV}" Width="180" />
                </Grid>

                 
                    <Button Grid.Column="0"  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="2" FontSize="16" Text="{Binding Source={Localization:Translate Word=查询}}"/>
                
                <Button    Click="ChgKeyCommand" Height="20" Margin="5,0,0,0" Width="Auto" Content="{Binding Source={Localization:Translate Word=修改编号}}" >
                   
                </Button>
            <TextBlock Text="{Binding Source={Localization:Translate Word=新编号001:}}"/>
            <ex:TXT72 Text="{Binding LFD,ElementName=TV}" MaxLength="3" PRE="000" Width="100" CharacterCasing="Upper" />
            </WrapPanel>
            <WrapPanel>
               
                <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                <TextBlock Text="{Binding Source={Localization:Translate Word=新编号001:}}"/>
                    <ex:TXT72 Text="{Binding LFD,ElementName=TV}" MaxLength="3" PRE="000" Width="100" CharacterCasing="Upper"  />
                <Button Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            <WrapPanel Visibility="{Binding IsCopy,ElementName=TV,Converter={StaticResource bv}}">
                <TextBlock Text="{Binding Source={Localization:Translate Word=新编号001:}}"/>
                    <ex:TXT72 Text="{Binding LFD,ElementName=TV}" MaxLength="3" PRE="000" Width="100" CharacterCasing="Upper"  />
                    <Button Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                </Button.Background>
                </Button>
            </WrapPanel>
            </WrapPanel>
             
        </StackPanel>
        <me:UZA03 Grid.Row="1"
                      x:Name="cD"
                   Margin="10,0,0,0"
                   ARTST="F"   
                   IsEdit="{Binding IsEdit,ElementName=TV}"
                   IsSaved="{Binding IsSaved,ElementName=TV}"
                 />
        <DataGrid  Grid.Row="2"  
                   VerticalAlignment="Top" 
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"  
                   ItemsSource="{Binding Source={StaticResource vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   IsReadOnly="True"
                   x:Name="dlgMaster" 
                   RowDetailsVisibilityMode="Visible"  
                >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=ZABNR, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=编号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABBEZ, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABZBIN1, Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=预付款%}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABZBIN2, Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=提货款%}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABZBIN3, Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=结单款%}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABSKONP1, Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=折扣%}}"  Width="Auto" />
                
                <DataGridTextColumn Binding="{Binding Path=ZABANZAHLG}" Header="{Binding Source={Localization:Translate Word=支付周期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABAENB}" Header="{Binding Source={Localization:Translate Word=修改}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABAEND}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABNEUB}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=ZABNEUD}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
            </DataGrid.Columns>
        </DataGrid  >
    </Grid>
</me:UIZABED>
